<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta content="text/javascript" http-equiv="content-script-type">
<title>tango.sys.win32.CodePage</title>

<link rel="stylesheet" type="text/css" href="css/style.css">
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="css/ie56hack.css"><![endif]-->
<script language="JavaScript" src="js/util.js" type="text/javascript"></script>
<script language="JavaScript" src="js/tree.js" type="text/javascript"></script>
<script language="JavaScript" src="js/explorer.js" type="text/javascript"></script>
<script>
function anchorFromTitle(title, path, ext) {
  var url = path + title + "." + ext;
  document.write("<a href='" + url + "'>" + title + "</a>");
  }
</script>
</head><body>
<div id="tabarea"></div><div id="explorerclient"></div>
<div id="content"><script>explorer.initialize("tango.sys.win32.CodePage");</script>
        <table class="content">
                <tr><td id="docbody"><h1><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/sys/win32/CodePage.d?rev=3461">tango.sys.win32.CodePage</a></h1>
                
<b>License:</b><br>
BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a><br><br>
<b>Version:</b><br>
Initial release: April 2007<br><br>
<b>author:</b><br>Kris<br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>struct <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/sys/win32/CodePage.d?rev=3461#L26">CodePage</a></span>
<script>explorer.outline.addDecl('CodePage');</script>;</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Convert text to and from Windows 'code pages'. This is non-portable,
        and will be unlikely to operate even across all Windows platforms.
        
</font><br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>bool <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/sys/win32/CodePage.d?rev=3461#L35">isAscii</a></span>
<script>explorer.outline.addDecl('isAscii');</script>(char[] <span class="funcparam">src</span>); [static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Test a text array to see if it contains non-ascii elements.
                Returns true if ascii, false otherwise</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/sys/win32/CodePage.d?rev=3461#L67">into</a></span>
<script>explorer.outline.addDecl('into');</script>(char[] <span class="funcparam">src</span>, char[] <span class="funcparam">dst</span>, uint <span class="funcparam">page</span> = 0); [static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Convert utf8 text to a codepage representation</font><br><br>
<font color="black">page  0     - the ansi code page
                      1     - the oem code page
                      2     - the mac code page
                      3     - ansi code page for the calling thread
                      65000 - UTF-7 translation
                      65001 - UTF-8 translation<br><br>                      or a region-specific codepage<br><br>                </font><br><br>
<b>Returns:</b><br>
a slice of the provided output buffer 
                         representing converted text<br><br>                Note that the input must be utf8 encoded. Note also
                that the dst output should be sufficiently large to
                accomodate the output; a size of 2*src.length would
                be enough to host almost any conversion<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/sys/win32/CodePage.d?rev=3461#L96">from</a></span>
<script>explorer.outline.addDecl('from');</script>(char[] <span class="funcparam">src</span>, char[] <span class="funcparam">dst</span>, uint <span class="funcparam">page</span> = 0); [static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Convert codepage text to a utf8 representation</font><br><br>
<font color="black">page  0     - the ansi code page
                      1     - the oem code page
                      2     - the mac code page
                      3     - ansi code page for the calling thread
                      65000 - UTF-7 translation
                      65001 - UTF-8 translation<br><br>                      or a region-specific codepage<br><br>                </font><br><br>
<b>Returns:</b><br>
a slice of the provided output buffer 
                         representing converted text<br><br>                Note that the input will be utf8 encoded. Note also
                that the dst output should be sufficiently large to
                accomodate the output; a size of 2*src.length would
                be enough to host almost any conversion<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/sys/win32/CodePage.d?rev=3461#L110">convert</a></span>
<script>explorer.outline.addDecl('convert');</script>(char[] <span class="funcparam">src</span>, char[] <span class="funcparam">dst</span>, uint <span class="funcparam">from</span>, uint <span class="funcparam">into</span>); [private, static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Internal conversion routine; we avoid heap activity for
                strings of short and medium length. A zero is appended 
                to the dst array in order to simplify C API conversions</font><br><br></dd></dl></dd></dl></td></tr>
                <tr><td id="docfooter">
                        Copyright (c) 2007 Kris Bell. All rights reserved :: page rendered by CandyDoc. Generated by <a href="http://code.google.com/p/dil">dil</a> on Sun Jun  8 17:12:55 2008.
                </td></tr>
        </table>
</div>
<script></script>
</body></html>